namespace SimpleWebServices.Web
{
    using SimpleWebServices;
    using SimpleWebServices.Configuration;
    using Xunit;

    public sealed class IResourceExtensionMethodsFacts
    {
        [Fact]
        public void typedef()
        {
            Assert.True(typeof(IResourceExtensionMethods).IsStatic());
        }

        [Fact]
        public void op_ApplyDefaultValuesOfT_IResource()
        {
            try
            {
                Default.Register<DefaultResource>("<resource title='Test' />");

                IResource actual = new TestResource().ApplyDefaultValues<TestResource>();

                Assert.Equal<string>("Test", actual.Title);
            }
            finally
            {
                Default.Reset();
            }
        }
    }
}